import http from "~/api/base/http.js";

//获取订单列表
export const getOrderList = (page = 1, size = 10, projectId = "", categoryId = "", state = "", keyword = "", startTime = null, endTime = null,) => {
    return http.requestGet("/portal/order/list/" + page + "/" + size + "?projectId=" + projectId + "&categoryId=" + categoryId + "&keyword=" + keyword + "&startTime=" + startTime + "&endTime=" + endTime + "&state=" + state);
};
//获取订单列表
export const getShoppingList = (page = 1, size = 99999) => {
    return http.requestGet("/portal/order/list/" + page + "/" + size + "?state=0");
};
//添加到购物车
export const addShoppingApi = (orderFrom) => {
    return http.requestPost("/portal/order/add", orderFrom);
};

//修改购物车物品
export const updateShoppingApi = (orderFrom) => {
    return http.requestPut("/portal/order", orderFrom);
};

//直接购买
export const buyApi = (orderFrom) => {
    return http.requestPost("/portal/order/buy", orderFrom);
};

//重新发货
export const reSendApi = (orderFrom) => {
    return http.requestPost("/portal/order/reSend", orderFrom);
};

//购物车购买
export const buyListApi = (orderFrom) => {
    return http.requestPost("/portal/order/buy/list", orderFrom);
};

//删除订单或者购物车内容
export const delListApi = (ids) => {
    return http.requestDeleteArr("/portal/order", "ids", ids);
};